<?php
 if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class Coupon extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->data['controller'] = 'coupon';         
        $this->load->model('Mcoupon');
    }
    
    public function index()
    {
        die(json_encode($this->Mcoupon->getData()));
    }
    
    public function detail()
    {
        die(json_encode($this->Mcoupon->getDetail()));
    }
    
    public function reviewcoupon(){
        $coupon_id  = $this->getParamInt("coupon_id");
        $user_id    = $this->getParamInt("user_id");
        $name       = $this->getParamString("name");
        $star       = $this->getParamInt("star");
        $content    = $this->getParamString("content");
        die(json_encode($this->Mcontent->reviewCouponDB($coupon_id,$user_id,$name,$star,$content)));
    }
    
    public function getreview()
    {
        die(json_encode($this->Mcoupon->getReviewCoupon()));
    }

}
